#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
    int n=129;
    while(not((n%2==1)&&(n%3==1)&&(n%4==1)&&(n%5==1)&&(n%6==1)&&(n%7==0))){
        n+=1;
    }
    cout << n;
    return 0;
}